using HCore.IOC.Context.Event.Attr;
using HCore.Tests.Runtime.DianDianDian.Event;
using HCore.Unity.Behaviour;

namespace HCore.Tests.Runtime.DianDianDian.UI
{
    public class UI : HCoreMonoBehaviour
    {
        private void Start()
        {
            Get("Canvas/GameStartPanel").SetActive(true);
            Get("Canvas/GamePanel").SetActive(false);
            Get("Canvas/GamePassPanel").SetActive(false);
        }

        [EventListener]
        public void OnGamePassEvent(GamePassEvent @event)
        {
            Get("Canvas/GamePanel").SetActive(false);
            Get("Canvas/GamePassPanel").SetActive(true);
        }

        [EventListener]
        public void OnGameStartEvent(GameStartEvent @event)
        {
            Get("Canvas/GamePanel").SetActive(true);
        }

        [EventListener]
        public void OnCountDownEndEvent(CountDownEndEvent @event)
        {
            Get("Canvas/GamePanel").SetActive(false);
            Get("Canvas/GameOverPanel").SetActive(true);
        }
    }
}